﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Infrastructure.Cache
{
    public interface ICacheManager
    {
        bool Exists(string key);

        bool Add(string key, object value);

        bool Add(string key, object value, TimeSpan expiresSliding, TimeSpan expiressAbsoulte);

        bool Add(string key, object value, TimeSpan expiresIn, bool isSliding = false);

        bool Remove(string key);

        void RemoveAll(IEnumerable<string> keys);

        T Get<T>(string key) where T : class;

        object Get(string key);

        IDictionary<string, object> GetAll(IEnumerable<string> keys);

        bool Replace(string key, object value);

        bool Replace(string key, object value, TimeSpan expiresSliding, TimeSpan expiressAbsoulte);

        bool Replace(string key, object value, TimeSpan expiresIn, bool isSliding = false);
    }
}
